package com.zengqingfa.basic.rest;

import com.zengqingfa.basic.dto.Car;
import com.zengqingfa.basic.dto.CarDto;
import com.zengqingfa.basic.mapstruct.CarConverter2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zengqingfa
 * @className MapstructController
 * @description
 * @create 2023/1/3 20:52
 */
@RestController
@RequestMapping("/mapstruct")
public class MapstructController {


    @Autowired
    private CarConverter2 carConverter;

    @RequestMapping("/carToDto")
    public CarDto carToDto(@RequestBody Car car) {
        CarDto carDto = carConverter.carToDto(car);
        return carDto;
    }

}